username = "nun"
password = "123"
uesr_status = False
type = input("输入登录方式")
def login(login_type):
    def check(func):
        def wrapper (*args,**kwrags):
            global uesr_status
            if not uesr_status:
                if login_type == "社交账号" or login_type == "博客账号":
                    user = input("请输入账号：")
                    pwd =  input("请输入密码：")
                    if user == username and pwd == password:
                        uesr_status = True
                    else:
                        print("用户名或者密码有误")
                else:
                    print("登录方式无效")
            if uesr_status:
                return func(*args,**kwrags)
        return wrapper
    return check
@login(type)
def chat():
    print("聊天")
@login(type)
def shop():
    print("购物")
if __name__ == "__main__":
    chat()
    shop()
